.class public Lcom/estrongs/fs/impl/usb/b;
.super Ljava/io/InputStream;
.source "UsbFileInputStream.java"


# static fields
.field private static final d:Ljava/lang/String;


# instance fields
.field private a:Les/e50;

.field private b:J

.field private c:J


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 1
    const-class v0, Lcom/estrongs/fs/impl/usb/b;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/estrongs/fs/impl/usb/b;->d:Ljava/lang/String;

    return-void
.end method

.method public constructor <init>(Les/e50;J)V
    .locals 2

    .line 1
    invoke-direct {p0}, Ljava/io/InputStream;-><init>()V

    const/4 v0, 0x0

    .line 2
    iput-object v0, p0, Lcom/estrongs/fs/impl/usb/b;->a:Les/e50;

    const-wide/16 v0, 0x0

    .line 3
    iput-wide v0, p0, Lcom/estrongs/fs/impl/usb/b;->b:J

    .line 4
    iput-wide v0, p0, Lcom/estrongs/fs/impl/usb/b;->c:J

    .line 5
    iput-object p1, p0, Lcom/estrongs/fs/impl/usb/b;->a:Les/e50;

    .line 6
    invoke-interface {p1}, Les/e50;->getLength()J

    move-result-wide v0

    iput-wide v0, p0, Lcom/estrongs/fs/impl/usb/b;->b:J

    .line 7
    iput-wide p2, p0, Lcom/estrongs/fs/impl/usb/b;->c:J

    return-void
.end method


# virtual methods
.method public close()V
    .locals 0
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    return-void
.end method

.method public read()I
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    const/4 v0, 0x1

    new-array v0, v0, [B

    .line 8
    invoke-virtual {p0, v0}, Lcom/estrongs/fs/impl/usb/b;->read([B)I

    move-result v1

    if-lez v1, :cond_0

    const/4 v1, 0x0

    .line 9
    aget-byte v0, v0, v1

    return v0

    :cond_0
    return v1
.end method

.method public read([B)I
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 7
    array-length v0, p1

    const/4 v1, 0x0

    invoke-virtual {p0, p1, v1, v0}, Lcom/estrongs/fs/impl/usb/b;->read([BII)I

    move-result p1

    return p1
.end method

.method public read([BII)I
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    if-nez p3, :cond_0

    const/4 p1, 0x0

    return p1

    .line 1
    :cond_0
    :try_start_0
    iget-wide v0, p0, Lcom/estrongs/fs/impl/usb/b;->c:J

    int-to-long v2, p3

    add-long/2addr v0, v2

    iget-wide v4, p0, Lcom/estrongs/fs/impl/usb/b;->b:J

    cmp-long p3, v0, v4

    if-lez p3, :cond_1

    iget-wide v0, p0, Lcom/estrongs/fs/impl/usb/b;->b:J

    iget-wide v2, p0, Lcom/estrongs/fs/impl/usb/b;->c:J

    sub-long v2, v0, v2

    :cond_1
    long-to-int p3, v2

    if-gtz p3, :cond_2

    const/4 p1, -0x1

    return p1

    .line 2
    :cond_2
    invoke-static {p1, p2, p3}, Ljava/nio/ByteBuffer;->wrap([BII)Ljava/nio/ByteBuffer;

    move-result-object p1

    .line 3
    iget-object p2, p0, Lcom/estrongs/fs/impl/usb/b;->a:Les/e50;

    iget-wide v0, p0, Lcom/estrongs/fs/impl/usb/b;->c:J

    invoke-interface {p2, v0, v1, p1}, Les/e50;->a(JLjava/nio/ByteBuffer;)V

    .line 4
    iget-wide p1, p0, Lcom/estrongs/fs/impl/usb/b;->c:J

    int-to-long v0, p3

    add-long/2addr p1, v0

    iput-wide p1, p0, Lcom/estrongs/fs/impl/usb/b;->c:J
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    return p3

    :catch_0
    move-exception p1

    .line 5
    invoke-virtual {p1}, Ljava/lang/Exception;->printStackTrace()V

    .line 6
    new-instance p1, Ljava/io/IOException;

    invoke-direct {p1}, Ljava/io/IOException;-><init>()V

    throw p1
.end method
